/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author LYS
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { TreeDataModel, TreeModel } from '../../../model/baseModel';

const { adminPath } = useGlobSetting();

export interface Bas3dwhPos extends TreeModel<Bas3dwhPos> {
  code?: string; // 货位编码
  name?: string; // 货位名称
  areaCode?: string; // 所属区域
  irow?: number; // 行号
  icol?: number; // 列号
  bxoCode?: string; // 箱子编码
  cstatus?: string; // 状态
  block?: string; // 是否锁定
  unlockDate?: string; // 解锁时间
  loker?: string; // 锁定人
}

export const bas3dwhPosList = (params?: Bas3dwhPos | any) =>
  defHttp.get<Bas3dwhPos>({ url: adminPath + '/bas/wms/pos/list', params });

export const bas3dwhPosListData = (params?: Bas3dwhPos | any) =>
  defHttp.post<Bas3dwhPos[]>({ url: adminPath + '/bas/wms/pos/listData', params });

export const bas3dwhPosListDataLevel = (params?: Bas3dwhPos | any) =>
  defHttp.post<Bas3dwhPos[]>({ url: adminPath + '/bas/wms/pos/listDataLevel', params });

export const bas3dwhPosForm = (params?: Bas3dwhPos | any) =>
  defHttp.get<Bas3dwhPos>({ url: adminPath + '/bas/wms/pos/form', params });

export const bas3dwhPosCreateNextNode = (params?: Bas3dwhPos | any) =>
  defHttp.get<Bas3dwhPos>({ url: adminPath + '/bas/wms/pos/createNextNode', params });

export const bas3dwhPosSave = (params?: any, data?: Bas3dwhPos | any) =>
  defHttp.postJson<Bas3dwhPos>({ url: adminPath + '/bas/wms/pos/save', params, data });

export const bas3dwhPosDelete = (params?: Bas3dwhPos | any) =>
  defHttp.get<Bas3dwhPos>({ url: adminPath + '/bas/wms/pos/delete', params });

export const bas3dwhPosTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/bas/wms/pos/treeData', params });
